<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
    .shape {
        font-family: monospace;
        text-align: center;
        padding-top: 20px;
        font-size: 18px;
    }
</style>
</head>
<body>
    <div id="triangleShape" class="shape"></div>
<div id="parallelogramShape" class="shape" ></div>

<script>
    function drawNumberTriangle(number, size) {
        var triangle = "";
        for (var i = 1; i <= size; i++) {
            triangle += number.toString().repeat(i) + "<br>";
        }
        document.getElementById('triangleShape').innerHTML = triangle;
    }

    function drawNumberParallelogram(number, size) {
        var parallelogram = "";
        for (var i = 1; i <= size; i++) {
            parallelogram += number.toString().repeat(size) + "<br>";
        }
        document.getElementById('parallelogramShape').innerHTML = parallelogram;
    }

    var number = prompt("请输入一个数字，它将用于填充数字三角形和平行四边形:", 5);
    var size = prompt("请输入数字三角形和平行四边形的大小（行数）:", 5);

    
    if (!isNaN(number) && !isNaN(size) && size > 0) {
        number = parseInt(number); 
        size = Math.abs(parseInt(size)); 
        drawNumberTriangle(number, size);
        drawNumberParallelogram(number, size);
    } else {
        alert("请输入有效的数字。");
    }
</script>
</body>
</html>